#include "ps_support.h"
#include "ps_debug.h"
#include <windows.h>
#include <stdio.h>



DebugWindow::DebugWindow():
mWindowName(" "), mWindowType("STATIC"),xleft(0),xright(0),ytop(0),ybottom(0),mHandle(NULL),mParentWindow(NULL),mIntVars(NULL)
{
	//nothing here :D
}

DebugWindow::DebugWindow(str WindowName, str WindowType, u8 x1, u8 x2, u8 y1, u8 y2, HWND parentwindow,u32* const IntVars):
mWindowName(WindowName), mWindowType(WindowType),xleft(x1),xright(x2),ytop(y1),ybottom(y2),mHandle(NULL),mParentWindow(parentwindow),mIntVars(IntVars){
//nothing here :D
}	

DebugWindow::~DebugWindow(){
	Exit();
}

void DebugWindow::Set(str WindowName, str WindowType, u8 x1, u8 x2, u8 y1, u8 y2, HWND parentwindow,u32* const IntVars){
	mWindowName = WindowName;
	mWindowType = WindowType;
	xleft = x1;
	xright = x2;
	ytop = y1;
	ybottom = y2;
	mParentWindow = parentwindow;
	mIntVars = IntVars;
}
void DebugWindow::Init(){
	mHandle = CreateWindowEx(0,mWindowType,mWindowName,WS_VISIBLE, xleft,ytop, xright, ybottom, mParentWindow, NULL, NULL, NULL);
	//mHandle = CreateWindow("MyWindowClass", "mWindowName", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, ghAppInstance, NULL);
}

void DebugWindow::Update(){
char buf[255];
sprintf(buf,"%d",*mIntVars);
SetWindowText(mHandle,buf);
}

void DebugWindow::Exit(){
DestroyWindow(mHandle);
}